#define _CRT_SECURE_NO_WARNINGS 1
#include "list.h"

void test()
{
	ListNode* plist = NULL;
	LTInit(&plist); 
	ListPrint(plist);

	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPrint(plist);

	ListPopBack(plist);
	ListPopBack(plist);
	ListPopBack(plist);
	//ListPopBack(plist);
	//ListPopBack(plist);
	//ListPopBack(plist);
	ListPrint(plist);

	ListPushFront(plist, 5);
	ListPushFront(plist, 6);
	ListPushFront(plist, 7);
	ListPushFront(plist, 8);
	ListPrint(plist);

	ListPopFront(plist);
	ListPopFront(plist);
	ListPopFront(plist);
	//ListPopFront(plist);
	//ListPopFront(plist);
	//ListPopFront(plist);
	ListPrint(plist);

	int x = 0;
	scanf("%d", &x);
	ListNode* pos = ListFind(plist, x);
	ListInsert(pos, x*2);
	ListPrint(plist);

	scanf("%d", &x);
	pos = ListFind(plist, x);
	ListInsert(pos, x*3);
	ListPrint(plist);

	scanf("%d", &x);
	pos = ListFind(plist, x);
	ListErase(pos);
	ListPrint(plist);

	ListDestory(plist);
	plist = NULL;
}

int main()
{
	test();
	return 0;
}